I am trying to utilize cython to provide a wrapper for my C++ utilities. One such function I am trying to make accessible is an accessor that retus an enum based on file type.
Here is how I re-define the function in cython:
cdef exte from "reader.h" namespace "magic_number":
enum mcr_magic_number_t:
MDI = 0
EOT
RV
UNKNOWN
and then in my reader.pxd file I have
cpdef mcr_magic_number_t magic_number(self)
and then in my 'reader.pyx' file I have
cpdef mcr_magic_number_t magic_number(self):
"""
:retu: the magic_number enum
:rtype: mcr_magic_number_t
"""
retu self.thisptr.magic_number()
Now, when I go to compile this, I get a waing
waing: ‘__pyx_r’ may be used uninitialized in this function
Anyone know how is best to get around this? I tried searching for solutions on google but all I got were pages of other people reporting the same __pyx_r error. Maybe there is a way to set a default value?
